 <%-- 
    Document   : viewcategories
    Created on : Jul 20, 2012, 10:36:56 PM
    Author     : Atienza-Home
--%>

<%@page import="Factory.Tables.Category"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%
        
        Category categoryedit = (Category)session.getAttribute("pickToEditCategory");
       
        
        %>
        <title>View Categories | Moviestore.com</title>
        
        <link href="../adminpanel/header.css" rel="stylesheet" type="text/css"></link>
        <script type="text/javascript" src="ajaxmain_admin.js"></script>
        <script type="text/javascript" src="jquery.js"></script>
        
        <script type="text/javascript">
            var name;
            var desc;
            
            
            function changepic(){
                var picpath = document.getElementById('categorypicbrowse').value.substr(12);
                
                document.getElementById("categorypic").innerHTML = "<img id='specificcategorypic' src='../"+picpath+"' name='"+picpath+"' style='border:2px solid black;'/><br><input id='categorypicbrowse'  type='file' onchange='javascript:changepic();'>";


            }       
            function changeName(){
                name = document.getElementById("spancategoryname").className;
                
                document.getElementById("categoryname").innerHTML = "<input id='editcategoryname' type='text'/ value='"+name+"' /> <font>[<a href='javascript:unchangeName()'>Unedit</a>]</font> ";
                
            }
            function unchangeName(){
                
                document.getElementById("categoryname").innerHTML = "<div id='spancategoryname' class='"+name+"' ><font color='white' style=' font-size: 25px;font-weight: bold;'>"+name+"<font style='font-weight:normal;font-size:15px;'>[<a href='javascript:changeName()'>Edit</a>]</font> </font></div>";
                
            }
            
            function changeDescription(){
                if(!desc)
                desc = document.getElementById("spancategorydesc").className;
                
                document.getElementById("categorydescription").innerHTML = "<textarea cols='115' rows='15' id='editcategorydescription'>"+desc+"</textarea> <font>[<a href='javascript:unchangeDescription()'>Unedit</a>]</font> ";
                
            }
            function unchangeDescription(){
                
                document.getElementById("categorydescription").innerHTML = "<div id='spancategorydesc' class="+desc+" ><font color='white'>&nbsp;&nbsp;"+desc+"[<a href='javascript:changeDescription()'> Edit</a>]</font><br></div>";
                
            }
    
        </script>
        
    </head>
    <body onload="retrieveCategories();">
        <div id="header"><font color="#006666" style=" font-size: 30px; font-weight: bold;">Categories | Moviestore.com</font></div>
        
        <div id="realbody">
            
            <div style=" padding-left: 0px; font-weight: bold;"><font color="black">Select categories:</font></div>
            
            <div id="categorytraverse">
                <div id="categorypaneloader"></div>
                
            </div>
                
            
            
            
            
        </div>
    </body>
</html>
